<template>
  <h1>{{ msg }}</h1>

  <p>
    <a href="https://vitejs.dev/guide/features.html" target="_blank">
      Vite Documentation
    </a>
    |
    <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a>
  </p>

  <button type="button" @click="state.count++">count is: {{ state.count }}</button>
  <button @click="handleClick">123</button>
  <p>
    Edit
    <code>components/HelloWorld.vue</code> to test hot module replacement.
  </p>
</template>

<script setup>
import { defineProps, getCurrentInstance, reactive } from 'vue'
const internalInstance = getCurrentInstance()
let ctx = internalInstance.appContext.config.globalProperties
defineProps({
  msg: String
})

const state = reactive({ count: 0 })
function handleClick() {
  console.log(import.meta.env.VITE_APP_API)
  ctx.$axios.getData({
    url: '/rest/emp/empalllist/all',
    method: 'GET'
  }).then(res => {
    console.log(res.data);
  })
}
</script>

<style scoped>
a {
  color: #42b983;
}
</style>
